package lab02.Test30;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Test {
    static double average;

    public static void main(String[] args) {
        double markIn;
        Scanner sc=new Scanner(System.in);
        List<Double> marks=new ArrayList<Double>();
        do{
            System.out.println("请输入一位学生的成绩：");
            markIn=sc.nextDouble();
            marks.add(markIn);
        }
        while(markIn>0);
        int len=marks.size()-1;
        marks.remove(len);
        for(int i=0;i<len;i++){
            average+=marks.get(i)/len;
        }
        System.out.println(len+"名学生的成绩平均分为："+average);
    }
}
